package com.owg.jigsaw.javafx.fxml;

import com.owg.jigsaw.WPane;
import com.owg.jigsaw.WRoot;
import com.owg.jigsaw.WWorkArea;

import javafx.geometry.Insets;
import javafx.scene.layout.Background;
import javafx.scene.layout.BackgroundFill;
import javafx.scene.layout.CornerRadii;
import javafx.scene.layout.Pane;
import javafx.scene.paint.Color;

public class FXWorkArea extends Pane implements WPaneSpawner
{	
	private WWorkArea model;
	
	public FXWorkArea()
	{
		super();
		setBackground(new Background(new BackgroundFill(Color.LIGHTGRAY, CornerRadii.EMPTY, Insets.EMPTY)));
	}

	@Override
	public WPane getWPane(WRoot root)
	{
		if(model == null)
			model = new WWorkArea(root, this);
		return model;
	}
}
